/*
 * Copyright @ 2025 weili23
 * com.example.ai.config 11:32
 * All right reserved.
 */

package com.example.ai.config;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @desc:会话记忆配置
 * @author: weili23
 * @createTime: 2025/4/29 11:32
 * @version: v1.0
 */
@Configuration
public class ChatMemoryAssistantConfig {

    @Bean
    public ChatMemory chatMemory() {
        return MessageWindowChatMemory.withMaxMessages(10);
    }
}
